﻿<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="@{/}">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>铁路中学成绩管理系统</title>
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="easyui/1.3.4/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="css/wu.css" />
    <link rel="stylesheet" type="text/css" href="css/icon.css" />
    <link rel="stylesheet" type="text/css" href="css/hsycmsAlert.css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/1.3.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/1.3.4/datagrid-export.js"></script>
    <script type="text/javascript" src="easyui/1.3.4/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="js/hsycmsAlert.js"></script><!-- 弹窗组件-->
    <script type="text/javascript" src="js/echarts.min.js"></script><!--图表-->
    <script type="text/javascript" src="js/echartsSettings.js"></script><!--图表设置-->
    <style type="text/css">
        .btn-line-height{
            line-height: 1.1;
            margin-bottom: 5px;
            margin-top: 5px;
        }
        .param-div{
            display: inline-block;
            width: 150px;
        }
        .param-button{
            display: inline-block;
            width: 80px;
        }
        .form-control-sm{
            width: 150px;
        }
        .col-6{
            padding-left: 0px;
            padding-right: 0px;
        }
    </style>
</head>
<body class="easyui-layout">
<!--普通弹窗-->
<div class="hsycms-model-mask" id="mask-alert"></div>
<div class="hsycms-model hsycms-model-alert" id="alert">
    <div class="hscysm-model-title">温馨提示</div>
    <div class="hsycms-model-text">这里是内容</div>
    <div class="hsycms-model-btn">
        <button type="button">确定</button>
    </div>
</div>
<!-- begin of header -->
<div class="wu-header" data-options="region:'north',border:false,split:true">
    <div class="wu-header-left">
        <h1>重庆市铁路中学校成绩管理系统</h1>
    </div>
    <div class="wu-header-right">
        <p><strong class="easyui-tooltip" th:text="${session.teacheronline.teacherName}"></strong>，欢迎您！</p>
        <p><a href="login_out">安全退出</a></p>
    </div>
</div>
<!-- end of header -->
<!-- begin of sidebar -->
<div class="wu-sidebar" data-options="region:'west',split:true,border:true,title:'导航菜单'">
    <div class="easyui-accordion" data-options="border:false,fit:true">
        <div title="数据查询" data-options="iconCls:'icon-application-form-edit'" style="padding:5px;">
            <ul class="easyui-tree wu-side-tree">
                <li iconCls="icon-chart-organisation">
                    <a href="javascript:void(0)" data-icon="icon-chart-organisation" data-link="queryteacherscore" iframe="0">查询学生成绩</a>
                </li>
                <li iconCls="icon-users">
                    <a href="javascript:void(0)" data-icon="icon-users" data-link="queryteacherstatistics" iframe="0">查询统计报表</a>
                </li>
            </ul>
        </div>
        <div title="统计图表" data-options="iconCls:'icon-wrench'" style="padding:5px;">
            <ul class="easyui-tree wu-side-tree">
                <li iconCls="icon-chart-organisation"><a href="javascript:void(0)" data-icon="icon-chart-organisation" data-link="distributechart" iframe="0">成绩分布</a></li>
            </ul>
        </div>
    </div>
</div>
<!-- end of sidebar -->
<!-- begin of main -->
<div class="wu-main" data-options="region:'center'">
    <div id="wu-tabs" class="easyui-tabs" data-options="border:false,fit:true">
        <div title="首页" data-options="href:'teacherwelcome',closable:false,iconCls:'icon-tip',cls:'pd3'"></div>
    </div>
</div>
<!-- end of main -->
<!-- begin of footer -->
<div class="wu-footer" data-options="region:'south',border:true,split:true" style="height: 30px;">
    &copy; 2021 cqtz All Rights Reserved
</div>
<!-- end of footer -->
<script type="text/javascript" th:inline="none">
    $(function(){
        //树形菜单事件绑定
        $('.wu-side-tree a').bind("click",function(){
            let title = $(this).text();
            let url = $(this).attr('data-link');
            let iconCls = $(this).attr('data-icon');
            let iframe = $(this).attr('iframe')==1?true:false;
            addTab(title,url,iconCls,iframe);
        });
    })

    /**
     * Name 选项卡初始化
     */
    $('#wu-tabs').tabs({
        tools:[{
            iconCls:'icon-reload',
            border:false,
            handler:function(){
                $('#wu-datagrid').datagrid('reload');
            }
        }]
    });

    /**
     * Name 添加菜单选项
     * Param title 名称
     * Param href 链接
     * Param iconCls 图标样式
     * Param iframe 链接跳转方式（true为iframe，false为href）
     */
    function addTab(title, href, iconCls, iframe){
        let tabPanel = $('#wu-tabs');
        if(!tabPanel.tabs('exists',title)){
            let content = '<iframe scrolling="auto" frameborder="0"  src="'+ href +'" style="width:100%;height:100%;"></iframe>';
            if(iframe){
                tabPanel.tabs('add',{
                    title:title,
                    content:content,
                    iconCls:iconCls,
                    fit:true,
                    cls:'pd3',
                    closable:true
                });
            }
            else{
                tabPanel.tabs('add',{
                    title:title,
                    href:href,
                    iconCls:iconCls,
                    fit:true,
                    cls:'pd3',
                    closable:true
                });
            }
        }
        else
        {
            tabPanel.tabs('select',title);
        }
    }
    /**
     * Name 移除菜单选项
     */
    // function removeTab(){
    // 	var tabPanel = $('#wu-tabs');
    // 	var tab = tabPanel.tabs('getSelected');
    // 	if (tab){
    // 		var index = tabPanel.tabs('getTabIndex', tab);
    // 		tabPanel.tabs('close', index);
    // 	}
    // }
</script>
</body>
</html>
